<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/css/amazeui.min.css">
    <link rel="stylesheet" href="/css/amazeui.cropper.css">
    <link rel="stylesheet" href="/css/custom_up_img.css">


    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/commone.css">
    <link rel="stylesheet" media="screen and (min-width:481px)" href="/css/usercenter.css">
    <link rel="stylesheet" media="screen and (max-width:480px)" href="/css/usercenter(1).css">

    <script src="/js/hm.js"></script>
    <script type="text/javascript">
        var basePath = "/";
    </script>
    <script src="/js/common.js"></script>
    <script src="/js/jquery-3.5.1.min.js"></script>
    <script src="/js/footfixed.js"></script>

    <script src="/js/layer.js"></script>
    <link rel="stylesheet" href="/css/layer(1).css" id="layuicss-layer">
    <title>个人中心</title>

    <link rel="stylesheet" th:href="@{/css/font.css}">
    <link rel="stylesheet" th:href="@{/css/xadmin.css}">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <script src="/js/amazeui.min.js"></script>
    <script src="/js/cropper.min.js"></script>
    <script src="/js/custom_up_img.js"></script>

</head>
<body>
<div class="content">

    <div th:replace="common/hasbei_top"></div>


    <div class="content-main">
        <div class="main-info">

            <div th:replace="user/user_left"></div>


            <div class="main-user-right">
                <div class="user-right-top">
                    <ul>
                        <li class="select-active" id="dy"><a href="javascript:;">站内消息</a></li>
                    </ul>
                </div>
                <div class="user-right-action">

                    <div id="myContent">
                        <div class="action-item" th:id="${'item'+massage.getId()}" th:each="massage:${userMassage}">
                            <div class="action-item-title">
                                <a href="javascript:;" target="_self" onclick="read(this)" th:id="${massage.getId()}"
                                   th:text="${massage.getMsgTitle()}"></a>
                            </div>
                            <div class="ansower-content">
                                <a href="javascript:;" target="_self" onclick="read(this)" th:id="${massage.getId()}">回复内容：<span
                                        th:text="${massage.getMsgContent()}"></span><br>审核描述：<span
                                        th:text="${massage.getMsgDescribe()}"></span></a>
                            </div>
                            <div class="ansower-share-setting">
                                <div class="ansower-share">
                                    <a href="javascript:;" target="_self" onclick="read(this)"
                                       th:id="${massage.getId()}">[回答审核]</a>
                                    <a href="#" onclick="read(this)" th:id="${massage.getId()}"><span
                                            th:text="${#dates.format(massage.getMsgTime(),'yyyy-MM-dd HH:mm:ss')}"></span></a>
                                    <a href="javascript:;" target="_self"><span
                                            th:text="${massage.getMsgStatus()}==1?'已读':'未读'" th:id="${'upd'+massage.getId()}"></span></a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="more-content">
                        <div class="load-more" style="display: none;">
                            <img src="/static/images/load-more.gif">
                            <span>加载中</span>
                        </div>
                        <div class="load-more-two load-more-fade" style="" th:userid="${uservo.getUserId()}"
                             onclick="moreList(this)">点击加载更多
                        </div>
                        <div class="no-data" style="display:none">┭┮﹏┭┮,没有数据啦</div>
                    </div>
                </div>

            </div>


        </div>
    </div>
    <script>
        // <!--  信息阅读 -->

        function read(obj) {
            var id = $(obj).attr("id");
            console.log(obj)
            $.get("/userMsgStatus?id="+id,function (item) {
                if(item.code == 201){
                    $("#upd"+id).html("已读");
                }
                layer.msg("已读")
            })

        }

        var page = 1;

        function moreList(obj) {
            var userid = $(obj).attr("userid");
            page++;

            $.get("/userStationPage?userid=" + userid + "&page=" + page, function (item) {
                if (item.length > 1) {

                    $("#myContent").append(item);
                } else {
                    $(".load-more-two").hide()
                    $(".no-data").show();
                }
            })
        }
    </script>

    <div th:replace="common/hasbei_bottom"></div>


    <script>
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?4245936cbef31e434e2b387b56dfd7d8";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
</div>
</body>

</html>